import uvicorn
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware

from src.config.log import configure_logger, LogMiddleware

# app = FastAPI(title="分析系统", description="用于分析税务、征信状况的系统", version="2.0.0", )
app = FastAPI(title="测试系统", description="测试系统", version="2.0.0", redirect_slashes=False)
app.add_middleware(LogMiddleware)
configure_logger()
if __name__ == "__main__":
    uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

import src.config.app_event  # noqa: F401
import src.routers  # noqa: F401
